package com.example.TokenUtil;

public class GetCookie {
    /**
     * 将token从cookievalue中分离出来
     * @param cookieValue
     * @return token
     */
    public static String getCookieValue(String cookieValue) {
        if (cookieValue != null) {
            String token = null;
            for (String cookie : cookieValue.split(";")) {
                String[] parts = cookie.trim().split("=");
                if (parts.length == 2 && "token".equals(parts[0])) {
                    token = parts[1];
                    return token;
                }
            }
        }
        return "无token";
    }
}
